<?php
/**
 * Created by PhpStorm.
 * User: R.Ice
 * Date: 2018/8/23
 * Time: 15:57
 * name:新增作业
 * url:/erpHomework/add_homework
 */

$oh_octid             = $route->bodyParams['oh_octid'];                 //关联的课时ID
$oh_name              = $route->bodyParams['oh_name'];                  //作业名称
$oh_content           = $route->bodyParams['oh_content'];               //作业内容
$oh_grade             = $route->bodyParams['oh_grade'];                 //作业评分 0-A 1-B 2-C 3-D
$oh_attachment_format = $route->bodyParams['oh_attachment_format'];    //附件格式 0-不限制 1-文字 2-图片 3-word 4-exel 5-视频
$oh_end_time          = $route->bodyParams['oh_end_time'];              //作业截至时间


//写入数组
$insertArr = [
    'oh_octid'              => $oh_octid,
    'oh_name'               => $oh_name,
    'oh_content'            => $oh_content,
    'oh_grade'              => $oh_grade,
    'oh_attachment_format' => $oh_attachment_format,
    'oh_end_time'           => $oh_end_time,
    'oh_create_time'        => time()
];
//执行写入语句
$rsData = $db->mysqlDB->insert("oa_homework",$insertArr);

//返回成功结果
$response->responseData( true, $rsData );